package me.boot.db.mybatis.interceptor.tenant;

import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import me.boot.common.constant.DbConst;
import me.boot.db.mybatis.template.entity.AutoEntity;

/**
 * 租户数据源表
 */
@Getter
@Setter
@TableName(DbConst.TENANT_DATASOURCE_TABLE_NAME)
@ApiModel("租户数据源表")
public class TenantDatasource extends AutoEntity {

    @ApiModelProperty(value = "线程池名称")
    private String poolName;
    @ApiModelProperty(value = "连接池类型", example = "com.alibaba.druid.pool.DruidDataSource")
    private String type = "com.alibaba.druid.pool.DruidDataSource";
    @ApiModelProperty(value = "驱动名称", example = "com.mysql.cj.jdbc.Driver")
    private String driverClassName = "com.mysql.cj.jdbc.Driver";
    @ApiModelProperty(value = "数据库连接url", example = "jdbc:mysql://127.0.0.1:3306/dynamic")
    private String url;
    @ApiModelProperty(value = "数据库用户名", example = "root")
    private String username;
    @ApiModelProperty(value = "数据库密码", example = "123456")
    private String password;
    @ApiModelProperty("jndiname")
    private String jndiName;
    @ApiModelProperty(value = "数据库结构初始化脚本", example = "db/schema.sql")
    private String schema;
    @ApiModelProperty(value = "数据库数据初始化脚本", example = "db/data.sql")
    private String data;
    @ApiModelProperty("是否启用seata")
    private Boolean seata = false;
    @ApiModelProperty("是否启用p6spy")
    private Boolean p6spy = false;
    @ApiModelProperty("是否懒加载")
    private Boolean lazy = true;
    @ApiModelProperty("发生错误时，是否继续")
    private boolean continueOnError = true;
    @ApiModelProperty("sql语句分隔符")
    private String separator = ";";
    @ApiModelProperty("公钥")
    private String publicKey;
    @ApiModelProperty("扩展属性")
    private String extra;
}
